import {RequestParam,HttpRequest} from '@/utils/http'

/**
 * 广告推广服务
 */
export const AdvertService = {
	// 通知列表
	listAdvert: function(type) {
		const request = new RequestParam();
		request.url = "/api/advert/list.do";
		request.param={type:type}
		return HttpRequest(request);
	}
}

/**
 * 优惠卷服务
 */
export const CouponService={
	listAvailableCoupon:function(productId){
		const request = new RequestParam();
		request.url = "/api/coupon/available.do";
		request.param={productId:productId}
		return HttpRequest(request);
	},
	// 领取优惠卷
	receiveCoupon:function(couponId){
		const request = new RequestParam();
		request.url = "/api/coupon/receive.do";
		request.param={couponId:couponId};
		return HttpRequest(request);
	},
	// 用户可用的优惠卷
	getUserCoupons:function(status){
		const request = new RequestParam();
		request.url = "/api/coupon/list.do";
		request.param={status:status};
		return HttpRequest(request);
	}
}